package com.test;

import com.wfg.nettydemo.netty.tcp.NettyServerHandler;
import io.netty.channel.Channel;
import io.netty.channel.DefaultChannelPipeline;
import io.netty.channel.ReflectiveChannelFactory;
import io.netty.channel.socket.nio.NioServerSocketChannel;

/**
 * @author wufagang
 * @description
 * @date 2022年07月09日 17:25
 */
public class DefaultChannelPipelineDemo extends DefaultChannelPipeline{

    protected DefaultChannelPipelineDemo(Channel channel) {
        super(channel);
    }

    public static void main(String[] args) {
        ReflectiveChannelFactory<NioServerSocketChannel> channelFactory = new ReflectiveChannelFactory<>(
                NioServerSocketChannel.class
        );
        NioServerSocketChannel channel = channelFactory.newChannel();
        DefaultChannelPipeline pipeline = new DefaultChannelPipelineDemo(channel);
        pipeline.addLast(new NettyServerHandler());
    }
}
